package com.caiheng.api.service.estate;

import com.caiheng.api.entity.estate.EstateRoom;
import com.caiheng.api.entity.estate.PropertyFeeOrder;
import com.caiheng.api.entity.estate.PropertyFeeOrderTemplate;
import com.caiheng.api.entity.wxuser.User;
import com.caiheng.api.service.base.BaseService;

import java.util.List;

/**
 * 物业费订单Service接口
 *
 * @author ruoyi
 * @date 2021-08-24
 */
public interface PropertyFeeOrderService extends BaseService<PropertyFeeOrder> {

    /**
     *  添加物业费订单
     * @param order
     * @param user
     * @return
     */
    long addOrder(PropertyFeeOrder order, User user);


    /**
     * 根据物业费导入模板 记录 添加物业费订单
     * @param user
     * @param beginMonth
     * @param endMonth
     * @return
     */
    long addOrderByTemplate(User user, EstateRoom estateRoom, String checkIds, String beginMonth, String endMonth);


    /**
     * 根据物业费导入模板 记录 添加物业费订单
     * @param user
     * @param beginMonth
     * @param endMonth
     * @return
     */
    long addOrderByTemplate1(User user, EstateRoom estateRoom, String chooseFee, String beginMonth, String endMonth);


    /**
     *  获得当前未处理的订单数量
     * @param estateId
     * @return
     */
    long getUnOpCount(int estateId);


    /**
     * 买家查订单
     * @param userId
     * @param state
     * @param pageIndex
     * @param pageSize
     * @return
     */
    List<PropertyFeeOrder> queryListByUserId(int userId, int state, int pageIndex, int pageSize);

    /**
     * 更新订单的状态
     * @return
     */
    int updateOrderState(PropertyFeeOrder feeOrder, int state);

    /**
     * 支付成功
     * @param feeOrder
     * @return
     */
    int payOver(PropertyFeeOrder feeOrder, List<PropertyFeeOrderTemplate> orderTemplates);


    /**
     *  取消未支付的订单
     * @param userId
     * @return
     */
    int cancelOrder(int userId);

    /**
     *  取消未支付订单
     * @param feeOrder
     * @return
     */
    int cancelNoPayOrder(PropertyFeeOrder feeOrder);

    /**
     *  单个 查询物业费支付订单并修改状态
     * @param propertyFeeOrder
     * @return
     */
    int queryOrder(PropertyFeeOrder propertyFeeOrder);
}
